import request from '@neu/biz-core/utils/request'
const baseUrl = 'dcam/api/w/spareconsume'

export const create = (data) => {
  return request({
    url: baseUrl + '/applyform',
    data,
    method: 'post'
  })
}

export const confirmUser = (workOrderNum) => {
  return request({
    url: baseUrl + '/confirmUser/' + workOrderNum,
    method: 'get'
  })
}

export const detail = (workOrderNum, taskId) => {
  return request({
    url: baseUrl + '/applyform/' + workOrderNum + '/' + taskId,
    method: 'get'
  })
}

export const leaderApprovalCreate = (data) => {
  return request({
    url: baseUrl + '/leaderapproval',
    data,
    method: 'post'
  })
}

export const leaderApprovalDetail = (workOrderNum, taskId) => {
  return request({
    url: baseUrl + '/leaderapproval/' + workOrderNum + '/' + taskId,
    method: 'get'
  })
}

export const listStockSelect = (params) => {
  return request({
    url: baseUrl + '/liststock',
    params,
    method: 'get'
  })
}

export const stockSave = (data) => {
  return request({
    url: baseUrl + '/stockselected',
    data,
    method: 'post'
  })
}

export const listBackSelect = (params) => {
  return request({
    url: baseUrl + '/listback',
    params,
    method: 'get'
  })
}

export const backSave = (data) => {
  return request({
    url: baseUrl + '/backsave',
    data,
    method: 'post'
  })
}
